package vn.edu.saigontech.ncms.service.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import vn.edu.saigontech.ncms.model.system.Bank;
import vn.edu.saigontech.ncms.model.system.BankAccount;
import vn.edu.saigontech.ncms.service.BankAccountService;

public class BankAccountServiceImpl extends HibernateGenericService<BankAccount, Long>
		implements BankAccountService {

	@Override
	public BankAccount findByNameNBank(String number, Bank bank) {
		Criteria criteria = this.createCriteria();
		criteria.add(Restrictions.eq("number", number));
		criteria.add(Restrictions.eq("bank", bank));
		return (BankAccount) criteria.uniqueResult();
	}
}